{{!--
  Original work Copyright (c) 2015 Nils Knappmeier
  https://github.com/bootprint/bootprint-json-schema

  Renders json-schema object properties.
--}}
{{#if properties}}
<section class="json-schema-properties">
  <dl>
    {{#each properties}}
      <dt data-property-name="{{htmlId @key}}"{{#if description}} class="has-description"{{/if}}>
        {{!Single property, default type is "object"}}
        <span class="json-property-name">{{@key}}:</span>
        {{>json-schema/datatype}}
        {{!>json-schema/datatype discriminator=(equal @key ../discriminator)}}
        {{#ifcontains ../required @key}}
          <span class="json-property-required"></span>
        {{/ifcontains}}
        {{#ifeq @key ../discriminator}}
          <span class="json-property-discriminator"></span>
        {{/ifeq}}
        {{#if readOnly}}
          <span class="json-property-read-only"></span>
        {{/if}}
      </dt>
      {{#if description}}
        <dd>
          {{md description}}
          {{!-- Show details of nested property schema
          <div class="json-inner-schema">
            {{>json-schema/body $ref="" description=""}}
          </div>
          --}}
        </dd>
      {{/if}}
      {{#if properties}}
        <dt class="json-inner-schema">
          {{~>json-schema/body $ref="" description=""}}
        </dt>
      {{/if}}
      {{#if items}}
        <dt class="json-inner-schema">
          {{~>json-schema/body $ref="" description=""}}
        </dt>
      {{/if}}
    {{/each}}
  </dl>
</section>
{{/if}}
